﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EventTest
{
    public class MsgSendEventArgs : System.EventArgs
    {
        public string Input { get; set; }
    }

    public class EventSender
    {
        public delegate void EventHandle(object sender, MsgSendEventArgs e);
        public event EventHandle SenderMsg;

        protected virtual void OnSenderMag(MsgSendEventArgs e)
        {
            if (SenderMsg != null)
            {
                SenderMsg(this, e);
            }
        }

        public void RiseSenderEvent(string input)
        {
            if (string.IsNullOrEmpty(input))
            {
                MsgSendEventArgs e = new MsgSendEventArgs { Input = input };
                OnSenderMag(e);
            }
        }
    }
}
